import request from '@/utils/request'

// GET /admin/product/baseTrademark/{page}/{limit} 获取品牌分页列表
export const reqGetTradeMarkLimit = (tradeMark) => request({
    url: `/list-api/admin/product/baseTrademark/${tradeMark.page}/${tradeMark.limit}`,
    method: 'get'
})
// 添加或修改品牌 区别是否带id
export const reqAddOrUpdateTrademark = (tradeMark) => {
    // 有id为修改品牌
    if (tradeMark.id) {
        return request({
            url: `/list-api/admin/product/baseTrademark/update`,
            method: 'put',
            data: tradeMark
        })
    } else {
        // 无id为添加品牌，品牌id让后端添加
        return request({
            url: `/list-api/admin/product/baseTrademark/save`,
            method: 'post',
            data: tradeMark
        })

    }
}
// delete /admin/product/baseTrademark/remove/{id} 删除品牌
export const reqDeleteTrademark = (id) => request({
    url: `/list-api/admin/product/baseTrademark/remove/${id}`,
    method: 'delete'
})